package com.sinochem.yunlian.ship.common.enums;

/**
 * Created by jayway on 2017/12/5.
 */
public enum CompanyType {

    CARGO(0,"货主"),
    SHIP(1,"船东");


    private int code;

    private String name;

    CompanyType(int code , String name){
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static CompanyType getStatusByCode(int code) {
        for (CompanyType companyType : CompanyType.values()) {
            if (companyType.getCode() == code) {
                return companyType;
            }
        }
        return null;
    }

}
